package org.jeie.actions;

import java.awt.Color;
import java.awt.Point;
import java.awt.image.BufferedImage;

import org.jeie.main.Action;
import org.jeie.messages.Messages;
import org.jeie.util.FloodFill;

public class FillAction implements Action {
	public Point p;
	public Color color;

	public FillAction(Point p, Color color) {
		this.p = p;
		this.color = color;
	}

	public String getName() {
		return Messages.getString("Action.Fill"); //$NON-NLS-1$
	}

	public BufferedImage apply(BufferedImage img) {
		FloodFill.nonrecursiveFill(img, p.x, p.y, color);
		return img;
	}
}
